package com.csun.cmny.provider.model.enums;

/**
 * @Auther: chenzheng
 * @Date: 2019-08-19
 * @Description: 系统人员类别
 */
public enum OmcUserTypeCodeEnum {
    //添加系统人员类别
    ,;

    /**
     * The code.
     */
    String code;
    /**
     * The Name.
     */
    String name;

    OmcUserTypeCodeEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    /**
     * Gets type.
     *
     * @return the type
     */
    public String getCode() {
        return code;
    }

    /**
     * Gets name.
     *
     * @return the name
     */
    public String getName() {
        return name;
    }


    /**
     * Gets name.
     *
     * @param code the code
     *
     * @return the name
     */
    public static String getName(String code) {
        for (OmcUserTypeCodeEnum ele : OmcUserTypeCodeEnum.values()) {
            if (code.equals(ele.getCode())) {
                return ele.getName();
            }
        }
        return null;
    }

    /**
     * Gets enum.
     *
     * @param code the code
     *
     * @return the enum
     */
    public static OmcUserTypeCodeEnum getEnum(String code) {
        for (OmcUserTypeCodeEnum ele : OmcUserTypeCodeEnum.values()) {
            if (code.equals(ele.getCode())) {
                return ele;
            }
        }
        return null;
    }

}
